package easy;

public class Solution_762 {

    public int countPrimeSetBits(int left, int right) {
        boolean[] ints = new boolean[20];
        ints[2] = true;
        ints[3] = true;
        ints[5] = true;
        ints[7] = true;
        ints[11] = true;
        ints[13] = true;
        ints[17] = true;
        ints[19] = true;

        int c = 0;
        for (int i = left; i <= right; i++) {
            int num = i, count = 0;
            while (num > 0) {
                count += num % 2;
                num = num >> 1;
            }
            if (ints[count]) {
                c++;
                System.out.println(i);
            }
        }
        return c;
    }

    public static void main(String[] args) {
        Solution_762 model = new Solution_762();
        System.out.println(model.countPrimeSetBits(6, 10));
//        System.out.println(model.countPrimeSetBits(10, 15));
    }
}
